import request from '@/utils/request'
const api_name = '/admin/product/baseTrademark'
export default {
    // GET /admin/product/baseTrademark/get/{id}
    //获取getTrademarkList
    // GET /admin/product/baseTrademark/getTrademarkList
    getTrademarkList(){
        return request({
            url:`${api_name}/getTrademarkList`,
            method: 'GET'
        })
    },
    //新增POST /admin/product/baseTrademark/save
    addTrademark({logoUrl,tmName}){
        return request({
            url:`${api_name}/save`,
            method: 'POST',
            data:{
                logoUrl,
                tmName
            }
        })
    },
    //DELETE /admin/product/baseTrademark/remove/{id}
    delTrademark(id){
        return request({
            url:`${api_name}/remove/${id}`,
            method: 'DELETE'
        })
    },
    // PUT /admin/product/baseTrademark/update
    updateTrademark({id,logoUrl,tmName}){
        return request({
            url:`${api_name}/update`,
            method:'PUT',
            data:{
                id,
                logoUrl,
                tmName
            }
        })
    },
    // GET /admin/product/baseTrademark/{page}/{limit}
    pageTrademark(page, limit){
        return request({
            url:`${api_name}/${page}/${limit}`,
            method:'GET',
        })
    },
    //新增或修改
    addOrUpdateTrademark({id,logoUrl,tmName}){
        if(id){
            //修改
            return request({
                url:`${api_name}/update`,
                method:'PUT',
                data:{
                    id,
                    logoUrl,
                    tmName
                }
            })
        }else{
            //新增
            return request({
                url:`${api_name}/save`,
                method: 'POST',
                data:{
                    logoUrl,
                    tmName
                }
            })
        }
    }
}